use colored::Colorize;

use crate::config::{get_param, Param};
use crate::data::AppState;

pub(crate) fn print_banner() {
    let Param { port, ip, .. } = get_param();
    let address = format!("http://{}:{}", ip, port);
    println!("服务启动中...,共享地址是: {}", address.blue(),);
}

pub(crate) fn get_data() -> AppState {
    let Param {
        count,
        filename,
        upload,
        ..
    } = get_param();
    AppState::new(filename, count, upload)
}
